package _3ChapterThree._4ChangeReferenceToValue;

import java.util.Objects;

public class Currency {
    private String _code;

    public Currency(String _code) {
        this._code = _code;
    }

    public String get_code() {
        return _code;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Currency currency = (Currency) o;
        return Objects.equals(_code, currency._code);
    }

    @Override
    public int hashCode() {
        return Objects.hash(_code);
    }

    public static void main(String[] args) {
        System.out.println(new Currency("CUD").equals(new Currency("CUD")));
    }
}
